 var nameStatic=cardStatic=phoneStatic=wordStatic= 0,formStatic;
        //姓名验证：
        $(".name").focus(function(){
            $(this).next("b").hide();
        }).blur(function(){
            var nameVal = $(this).val();
            var regExp = /^[\u4e00-\u9fff]+$/;
                    if(!nameVal) {
                        $(this).next("b").show();
                        nameStatic=0;
                        tipsShow();
                        return false;
                        // 判断输入的姓名是否是中文
                    }else if(regExp.test(nameVal)) {
                        // 真实姓名的长度是否符合要求
                        if(nameVal.length < 2 || nameVal.length > 10) {
                            $(this).next("b").show();
                            nameStatic=0;
                            tipsShow();
                            return false;
                        }else {
                            $(this).next("b").hide();
                            nameStatic=1;
                            tipsHide();
                        }
                    }else{
                        $(this).next("b").show();
                        nameStatic=0;
                        tipsShow();
                    }
        });
        //身份证号验证：
        $(".card").focus(function(){
            $(this).next("b").hide();
        }).blur(function(){
                    var cardVal = $(this).val();
                     var cardReg = /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/;
                     var   that=$(this)
                    if(!cardVal) {
                        $(this).next("b").show();
                        cardStatic=0;
                        tipsShow();
                        return false;
                    }else if(cardReg.test(cardVal)) {
                    	 $.ajax({
                    		      type : "POST",
                    		      async : false,
                    		      url :base+"/anon/cust/card", 
                    		      cache : false,
                    		      dataType : "JSON",
                    		      data:{"card":cardVal},
                    		      success : function(data){
                    		    	  if(data.success){
                    		    		  that.next("b").hide();
                    		    		  cardStatic=1; 
                    		    		  tipsHide();
                    		    	  }else{
                    		    		  that.next("b").show();
                    		    		  cardStatic=0; 
                    		    		  tipsShow();
                    		    	  }
                    		      },
                    		     error:function(e){
                    		        alert("error");
                    	       }
                    	    });
                    	
//                        // 身份证验证
//                        $(this).next("b").hide();
//                        cardStatic=1;
//                        tipsHide();
                    }else{
                        $(this).next("b").show();
                        cardStatic=0;
                        tipsShow();
                    }
                });
        //手机号验证：
        $(".phone").focus(function(){
            $(this).next("b").hide();
        }).blur(function(){
                    var phoneVal = $(this).val();
                    var phoneExp =  /^(((13[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
                    if(!phoneVal) {
                        $(this).next("b").show();
                        phoneStatic=0;
                        tipsShow();
                        return false;
                    }else if(phoneExp.test(phoneVal)) {
                        // 手机号验证
                        $(this).next("b").hide();
                        phoneStatic=1;
                        tipsHide();
                    }else{
                        $(this).next("b").show();
                        phoneStatic=0;
                        tipsShow();
                    }
                });
        //短信验证码验证：
        $(".word").focus(function(){
            $(this).parents("li").children("b").hide();
        }).blur(function(){
                    var wordVal = $(this).val();
                    if(!wordVal) {
                        $(this).parents("li").children("b").show();
                        wordStatic=0;
                        tipsShow();
                        return false;
                    }else{
                        // 手机号验证
                        $(this).parents("li").children("b").hide();
                        wordStatic=1;
                        tipsHide();
                    }
                });

        function tipsShow(){
            $(".liTips").text("*请输入正确信息");
        }
        function tipsHide(){
            formStatic=nameStatic * cardStatic * phoneStatic * wordStatic;
            if(formStatic){
                $(".liTips").text("");
                $(".liBtn input").css({"background":"#1077cf"});
            }
        }

        $(".send").click(function(){
        	var phone=$.trim($("#phone").val());
            $(".send").addClass("active").val('120s').attr("disabled","disabled");
            var time=120;
            var timer=setInterval(function(){
                time--;
                if(time>-1){
                    $(".send").addClass("active").val(time+"s");
                }else{
                    $(".send").removeClass("active").val("重新发送").removeAttr("disabled");
                    clearInterval(timer);
                }
            },1000);
            $.post(base+"/anon/phone/vcode/"+phone,{},function(data){
        		if(data.state==200){
        			tip.infoOnly("验证码已发送");
        		}else{
        			tip.infoOnly(data.msg);
        		}
        	},"json");
        });

        $(".liBtn input").click(function(){
            formStatic=nameStatic * cardStatic * phoneStatic * wordStatic;
            if(formStatic){
            	var custName=$.trim($("#custName").val());
            	var phone=$.trim($("#phone").val());
            	var cradId=$.trim($("#cradId").val());
            	var smscode=$.trim($("#smscode").val());
            	 $.ajax({
            	        type:'POST',
            	        url:base+'/anon/cust/binding',
            	        data:{"cradId":cradId,"smscode":smscode,"custName":custName,"phone":phone},
            	        dataType: "json",
            	        success:function(data){
            	          if(data.state=="success"){
            	        	  $(".alertWin").show();
            	              return false;
            	          }else{
            	          	  tip.info(data.msg);
            	          }
            	        }
            	    });
               
            }else{
                tipsShow();
            }
        });